## $Biomass_borealDataPrep
## [1] "SpaDES.core"
## [2] "achubaty/amc@development"
## [3] "crayon"
## [4] "data.table"
## [5] "dplyr"
## [6] "fasterize"
## [7] "plyr"
## [8] "PredictiveEcology/LandR@development"
## [9] "PredictiveEcology/pemisc@development"
## [10] "raster"
## [11] "sf"
## [12] "sp"
## [13] "SpaDES.tools"
| paramName | paramClass | default | min | max | paramDesc |
|---|---|---|---|---|---|
| biomassModel | call | lme4::lmer(B ~ logAge * speciesCode + cover * speciesCode + (logAge + cover + speciesCode | ecoregionGroup)) | NA | NA | Model and formula for estimating biomass (B) from ecoregionGroup (currently ecoDistrict * LandCoverClass), speciesCode, logAge (gives a downward curving relationship), and cover. Defaults to a LMEM, which can be slow if dealing with very large datasets (e.g. 36 000 points take 20min). For faster fitting try P(sim)$subsetDataBiomassModel == TRUE, or quote(RcppArmadillo::fastLm(formula = B ~ logAge * speciesCode * ecoregionGroup + cover * speciesCode * ecoregionGroup)). A custom model call can also be provided, as long as the ‘data’ argument is NOT included. |
| coverModel | call | glm(cbind(coverPres, coverNum - coverPres) ~ speciesCode * ecoregionGroup, family = binomial) | NA | NA | Model and formula used for estimating cover from ecoregion and speciesCode and potentially others. Defaults to a GLMEM if there are > 1 grouping levels. A custom model call can also be provided, as long as the ‘data’ argument is NOT included |
| ecoregionLayerField | character | NULL | NA | NA | the name of the field used to distinguish ecoregions, if supplying a polygon. The default is ‘ECODISTRIC’ where available (for legacy reasons), else the row numbers of sim$ecoregionLayer. If this field is not numeric, it will be coerced to numeric |
| forestedLCCClasses | numeric | c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 20, 32, 34, 35) | 0 | 39 | The classes in the rstLCC layer that are ‘treed’ and will therefore be run in Biomass_core. Defaults to forested classes in LCC2005 map. |
| LCCClassesToReplaceNN | numeric | 34:35 | NA | NA | This will replace these classes on the landscape with the closest forest class P(sim)$forestedLCCClasses. If the user is using the default 2005 data product for rstLCC, then users may wish to include 36 (cities – if running a historic range of variation project), and 34:35 (burns) Since this is about estimating parameters for growth, it doesn’t make any sense to have unique estimates for transient classes in most cases |
| omitNonTreedPixels | logical | TRUE | FALSE | TRUE | Should this module use only treed pixels, as identified by P(sim)$forestedLCCClasses? |
| pixelGroupAgeClass | numeric | params(sim)\(Biomass_borealDataPrep\)successionTimestep | NA | NA | When assigning pixelGroup membership, this defines the resolution of ages that will be considered ‘the same pixelGroup’, e.g., if it is 10, then 6 and 14 will be the same |
| pixelGroupBiomassClass | numeric | 100 | NA | NA | When assigning pixelGroup membership, this defines the resolution of biomass that will be considered ‘the same pixelGroup’, e.g., if it is 100, then 5160 and 5240 will be the same |
| speciesUpdateFunction | list | list(LandR::speciesTableUpdate(sim\(species, sim\)speciesTable, sim\(sppEquiv, P(sim)\)sppEquivCol)) | NA | NA | Unnamed list of quoted functions that updates species table to customize values. Default should always come first. |
| sppEquivCol | character | Boreal | NA | NA | The column in sim$specieEquivalency data.table to use as a naming convention |
| subsetDataAgeModel | numeric | NULL | NA | NA | the number of samples to use when subsampling the biomass data model; if TRUE, uses 50 |
| subsetDataBiomassModel | numeric | NULL | NA | NA | the number of samples to use when subsampling the biomass data model; if TRUE, uses 50 |
| successionTimestep | numeric | 10 | NA | NA | defines the simulation time step, default is 10 years |
| useCloudCacheForStats | logical | TRUE | NA | NA | Some of the statistical models take long (at least 30 minutes, likely longer). If this is TRUE, then it will try to get previous cached runs from googledrive |
| .plotInitialTime | numeric | NA | NA | NA | This describes the simulation time at which the first plot event should occur |
| .plotInterval | numeric | NA | NA | NA | This describes the simulation time interval between plot events |
| .saveInitialTime | numeric | NA | NA | NA | This describes the simulation time at which the first save event should occur |
| .saveInterval | numeric | NA | NA | NA | This describes the simulation time interval between save events |
| .useCache | character | c(“.inputObjects”, “init”) | NA | NA | Internal. Can be names of events or the whole module name; these will be cached by SpaDES |
| objectName | objectClass | desc | sourceURL |
|---|---|---|---|
| cloudFolderID | character | The google drive location where cloudCache will store large statistical objects | NA |
| columnsForPixelGroups | character | The names of the columns in cohortData that define unique pixelGroups. Default is c(‘ecoregionGroup’, ‘speciesCode’, ‘age’, ‘B’) | NA |
| ecoregionLayer | SpatialPolygonsDataFrame | A SpatialPolygonsDataFrame that characterizes the unique ecological regions used to parameterize the biomass, cover, and species establishment probability models. It will be overlaid with landcover to generate classes for every ecoregion/LCC combination. It must have same extent and crs as studyAreaLarge if suppplied by user. It is superseded by sim$ecoregionRst if that object is supplied by the user | http://sis.agr.gc.ca/cansis/nsdb/ecostrat/district/ecodistrict_shp.zip |
| ecoregionRst | RasterLayer | A raster that characterizes the unique ecological regions used to parameterize the biomass, cover, and species establishment probability models. If this object is provided, it will supersede sim$ecoregionLayer. It will be overlaid with landcover to generate classes for every ecoregion/LCC combination. It must have same extent and crs as rasterToMatchLarge if suppplied by user - use reproducible::postProcess. If it uses an attribute table, it must contain the field ‘ecoregion’ to represent raster values | NA |
| rstLCC | RasterLayer | A land classification map in study area. It must be ‘corrected’, in the sense that: | |
| 1) Every class must not | conflict with any other ma | p in this module | |
| (e.g., speciesLayer | s should not have data in L | CC classes that are non-treed); | |
| 2) It can have treed an | d non-treed classes. The no | n-treed will be removed within this | |
| module if P(sim)$om | itNonTreedPixels is TRUE; | ||
| 3) It can have transien | t pixels, such as ’young fi | re’. These will be converted to a | |
| the nearest non-tra | nsient class, probabilistic | ally if there is more than 1 nearest | |
| neighbour class, ba | sed on P(sim)$LCCClassesToR | eplaceNN. | |
| The default layer used, | if not supplied, is Canada | national land classification in 2005. The metadata (res, proj, ext, origin) need to match rasterToMatchLarge. ftp://ftp.ccrs.nrcan.gc.ca/ad/NLCCLandCover/LandcoverCanada2005_250m/LandCoverOfCanada2005_V1_4.zip | |
| rasterToMatch | RasterLayer | A raster of the studyArea in the same resolution and projection as rawBiomassMap. This is the scale used for all outputs for use in the simulation. | NA |
| rasterToMatchLarge | RasterLayer | A raster of the studyAreaLarge in the same resolution and projection as rawBiomassMap. This is the scale used for all inputs for use in the simulation. | NA |
| rawBiomassMap | RasterLayer | total biomass raster layer in study area. Defaults to the Canadian Forestry Service, National Forest Inventory, kNN-derived total aboveground biomass map from 2001. If necessary, biomass values are rescaled to match changes in resolution. See https://open.canada.ca/data/en/dataset/ec9e2659-1c29-4ddb-87a2-6aced147a990 for metadata. | http://ftp.maps.canada.ca/pub/nrcan_rncan/Forests_Foret/canada-forests-attributes_attributs-forests-canada/2001-attributes_attributs-2001/NFI_MODIS250m_2001_kNN_Structure_Biomass_TotalLiveAboveGround_v1.tif |
| speciesLayers | RasterStack | cover percentage raster layers by species in Canada species map. Defaults to the Canadian Forestry Service, National Forest Inventory, kNN-derived species cover maps from 2001 using a cover threshold of 10 - see https://open.canada.ca/data/en/dataset/ec9e2659-1c29-4ddb-87a2-6aced147a990 for metadata | http://ftp.maps.canada.ca/pub/nrcan_rncan/Forests_Foret/canada-forests-attributes_attributs-forests-canada/2001-attributes_attributs-2001/ |
| speciesTable | data.table | species attributes table, default is from Dominic Cyr and Yan Boulanger’s project | https://raw.githubusercontent.com/dcyr/LANDIS-II_IA_generalUseFiles/master/speciesTraits.csv |
| sppColorVect | character | named character vector of hex colour codes corresponding to each species | |
| sppEquiv | data.table | table of species equivalencies. See LandR::sppEquivalencies_CA. | |
| sppNameVector | character | an optional vector of species names to be pulled from sppEquiv. If not provided, then species will be taken from the entire P(sim)$sppEquivCol in sppEquiv. See LandR::sppEquivalencies_CA. | |
| standAgeMap | RasterLayer | stand age map in study area. Defaults to the Canadian Forestry Service, National Forest Inventory, kNN-derived biomass map from 2001 - see https://open.canada.ca/data/en/dataset/ec9e2659-1c29-4ddb-87a2-6aced147a990 for metadata | http://ftp.maps.canada.ca/pub/nrcan_rncan/Forests_Foret/canada-forests-attributes_attributs-forests-canada/2001-attributes_attributs-2001/NFI_MODIS250m_2001_kNN_Structure_Stand_Age_v1.tif |
| studyArea | SpatialPolygonsDataFrame | Polygon to use as the study area. Defaults to an area in Southwestern Alberta, Canada. | |
| studyAreaLarge | SpatialPolygonsDataFrame | multipolygon (larger area than studyArea) used for parameter estimation, with attribute LTHFC describing the fire return interval. Defaults to a square shapefile in Southwestern Alberta, Canada. |
| objectName | objectClass | desc |
|---|---|---|
| biomassMap | RasterLayer | total biomass raster layer in study area, filtered for pixels covered by cohortData |
| cohortData | data.table | initial community table, created from available biomass, age and species cover data, as well as eco zonation information |
| ecoregion | data.table | ecoregion look up table |
| ecoregionMap | RasterLayer | ecoregion map that has mapcodes match ecoregion table and speciesEcoregion table |
| pixelGroupMap | RasterLayer | initial community map that has mapcodes match initial community table |
| minRelativeB | data.frame | define the cut points to classify stand shadeness |
| rawBiomassMap | RasterLayer | total biomass raster layer in study area. Defaults to the Canadian Forestry Service, National Forest Inventory, kNN-derived total aboveground biomass map from 2001. See https://open.canada.ca/data/en/dataset/ec9e2659-1c29-4ddb-87a2-6aced147a990 for metadata |
| species | data.table | a table that has species traits such as longevity… |
| speciesEcoregion | data.table | define the maxANPP, maxB and establishprob change with both ecoregion and simulation time |
| studyArea | Polygon to use as the study area. Defaults to an area in Southwestern Alberta, Canada. | |
| sufficientLight | data.frame | define how the species with different shade tolerance respond to stand shadeness |
## $Biomass_core
## [1] "SpaDES.core"
## [2] "compiler"
## [3] "data.table"
## [4] "dplyr"
## [5] "fpCompare"
## [6] "ggplot2"
## [7] "grid"
## [8] "ianmseddy/LandR.CS@master"
## [9] "parallel"
## [10] "PredictiveEcology/LandR@development"
## [11] "PredictiveEcology/pemisc@development"
## [12] "PredictiveEcology/reproducible@development"
## [13] "PredictiveEcology/SpaDES.core@development"
## [14] "PredictiveEcology/SpaDES.tools@development"
## [15] "purrr"
## [16] "quickPlot"
## [17] "R.utils"
## [18] "raster"
## [19] "Rcpp"
## [20] "scales"
## [21] "sp"
## [22] "tidyr"
| paramName | paramClass | default | min | max | paramDesc |
|---|---|---|---|---|---|
| calcSummaryBGM | character | end | NA | NA | A character vector describing when to calculate the summary of biomass, growth and mortality Currently any combination of 5 options is possible: ‘start’- as before vegetation succession events, i.e. before dispersal, ‘postDisp’ - after dispersal, ‘postRegen’ - after post-disturbance regeneration (currently the same as ‘start’), ‘postGM’ - after growth and mortality, ‘postAging’ - after aging, ‘end’ - at the end of vegetation succesion events, before plotting and saving. The ‘end’ option is always active, being also the default option. |
| calibrate | logical | FALSE | NA | NA | Do calibration? Defaults to FALSE |
| gmcsPctLimits | numeric | c(66.6666666666667, 150) | NA | NA | if using LandR.CS for climate-sensitive growth and mortality, a percentile is used to estimate the effect of climate on growth/mortality (currentClimate/referenceClimate). Upper and lower limits are suggested to circumvent problems caused by very small denominators as well as predictions outside the data range used to generate the model |
| growthAndMortalityDrivers | character | LandR | NA | NA | package name where the following functions can be found: calculateClimateEffect, assignClimateEffect (see LandR.CS for climate sensitivity, leave default if none desired) |
| growthInitialTime | numeric | start(sim) | NA | NA | Initial time for the growth event to occur |
| initialBiomassSource | character | cohortData | NA | NA | Currently, there are three options: ‘spinUp’, ‘cohortData’, ‘biomassMap’. If ‘spinUp’, it will derive biomass by running spinup derived from Landis-II. If ‘cohortData’, it will be taken from the ‘cohortData’ object, i.e., it is already correct, by cohort. If ‘biomassMap’, it will be taken from sim\(biomassMap, divided across species using sim\)speciesLayers percent cover values spinUp uses sim$ageMap as the driver, so biomass is an output. That means it will be unlikely to match any input information about biomass, unless this is set to TRUE, and a sim$rawBiomassMap is supplied. |
| mixedType | numeric | 2 | NA | NA | How to define mixed stands: 1 for any species admixture; 2 for deciduous > conifer. See ?vegTypeMapGenerator. |
| plotOverstory | logical | FALSE | NA | NA | swap max age plot with overstory biomass |
| seedingAlgorithm | character | wardDispersal | NA | NA | choose which seeding algorithm will be used among noDispersal, universalDispersal, and wardDispersal (default). Species dispersal distances (in the ‘species’ table) are based on LANDIS-II parameters. |
| spinupMortalityfraction | numeric | 0.001 | NA | NA | defines the mortality loss fraction in spin up-stage simulation |
| sppEquivCol | character | Boreal | NA | NA | The column in sim$specieEquivalency data.table to use as a naming convention |
| successionTimestep | numeric | 10 | NA | NA | defines the simulation time step, default is 10 years. Note that growth and mortality always happen on a yearly basis. |
| vegLeadingProportion | numeric | 0.8 | 0 | 1 | a number that define whether a species is leading for a given pixel |
| .maxMemory | numeric | 5 | NA | NA | maximum amount of memory (in GB) to use for dispersal calculations. |
| .plotInitialTime | numeric | 0 | NA | NA | Vector of length = 1, describing the simulation time at which the first plot event should occur. Set to NA to turn plotting off. |
| .plotInterval | numeric | NA | NA | NA | defines the plotting time step. If NA, the default, .plotInterval is set to successionTimestep. |
| .plotMaps | logical | TRUE | NA | NA | Controls whether maps should be plotted or not |
| .saveInitialTime | numeric | NA | NA | NA | Vector of length = 1, describing the simulation time at which the first save event should occur. Set to NA if no saving is desired. If not NA, then saving will occur at .saveInitialTime with a frequency equal to .saveInterval |
| .saveInterval | numeric | NA | NA | NA | defines the saving time step. If NA, the default, .saveInterval is set to successionTimestep. |
| .useCache | character | c(“.inputObjects”, “init”) | NA | NA | Internal. Can be names of events or the whole module name; these will be cached by SpaDES |
| .useParallel | ANY | 2 | NA | NA | Used only in seed dispersal. If numeric, it will be passed to data.table::setDTthreads and should be <= 2; If TRUE, it will be passed to parallel:makeCluster; and if a cluster object, it will be passed to parallel::parClusterApplyB. |
| objectName | objectClass | desc | sourceURL |
|---|---|---|---|
| biomassMap | RasterLayer | total biomass raster layer in study area, filtered for pixels covered by cohortData. Only used if P(sim)$initialBiomassSource == ‘biomassMap’ | |
| cohortData | data.table | Columns: B, pixelGroup, speciesCode, Indicating several features about ages and current vegetation of stand | NA |
| ecoregion | data.table | ecoregion look up table | https://raw.githubusercontent.com/LANDIS-II-Foundation/Extensions-Succession/master/biomass-succession-archive/trunk/tests/v6.0-2.0/ecoregions.txt |
| ecoregionMap | RasterLayer | ecoregion map that has mapcodes match ecoregion table and speciesEcoregion table. Defaults to a dummy map matching rasterToMatch with two regions | NA |
| lastReg | numeric | an internal counter keeping track of when the last regeneration event occurred | NA |
| minRelativeB | data.frame | table defining the cut points to classify stand shadeness | NA |
| pixelGroupMap | RasterLayer | initial community map that has mapcodes match initial community table | NA |
| rasterToMatch | RasterLayer | a raster of the studyArea in the same resolution and projection as rawBiomassMap | NA |
| species | data.table | a table that has species traits such as longevity, shade tolerance, etc. Default is partially based on Dominic Cir and Yan’s project | https://raw.githubusercontent.com/dcyr/LANDIS-II_IA_generalUseFiles/master/speciesTraits.csv |
| speciesEcoregion | data.table | table defining the maxANPP, maxB and SEP, which can change with both ecoregion and simulation time. Defaults to a dummy table based on dummy data os biomass, age, ecoregion and land cover class | NA |
| speciesLayers | RasterStack | cover percentage raster layers by species in Canada species map. Defaults to the Canadian Forestry Service, National Forest Inventory, kNN-derived species cover maps from 2001 using a cover threshold of 10 - see https://open.canada.ca/data/en/dataset/ec9e2659-1c29-4ddb-87a2-6aced147a990 for metadata | http://ftp.maps.canada.ca/pub/nrcan_rncan/Forests_Foret/canada-forests-attributes_attributs-forests-canada/2001-attributes_attributs-2001/ |
| sppColorVect | character | A named vector of colors to use for plotting. The names must be in sim\(speciesEquivalency[[sim\)sppEquivCol]], and should also contain a color for ‘Mixed’ | NA |
| sppEquiv | data.table | table of species equivalencies. See LandR::sppEquivalencies_CA. | |
| studyArea | SpatialPolygonsDataFrame | Polygon to use as the study area. Defaults to an area in Southwestern Alberta, Canada. | |
| studyAreaReporting | SpatialPolygonsDataFrame | multipolygon (typically smaller/unbuffered than studyArea) to use for plotting/reporting. Defaults to an area in Southwestern Alberta, Canada. | NA |
| sufficientLight | data.frame | table defining how the species with different shade tolerance respond to stand shadeness. Default is based on LANDIS-II Biomass Succession v6.2 parameters | https://raw.githubusercontent.com/LANDIS-II-Foundation/Extensions-Succession/master/biomass-succession-archive/trunk/tests/v6.0-2.0/biomass-succession_test.txt |
| treedFirePixelTableSinceLastDisp | data.table | 3 columns: pixelIndex, pixelGroup, and burnTime. Each row represents a forested pixel that was burned up to and including this year, since last dispersal event, with its corresponding pixelGroup and time it occurred |
| objectName | objectClass | desc |
|---|---|---|
| activePixelIndex | integer | internal use. Keeps track of which pixels are active |
| activePixelIndexReporting | integer | internal use. Keeps track of which pixels are active in the reporting study area |
| ANPPMap | RasterLayer | ANPP map at each succession time step |
| cohortData | data.table | age cohort-biomass table hooked to pixel group map by pixelGroupIndex at succession time step |
| inactivePixelIndex | logical | internal use. Keeps track of which pixels are inactive |
| inactivePixelIndexReporting | integer | internal use. Keeps track of which pixels are inactive in the reporting study area |
| lastFireYear | numeric | Year of the most recent fire year |
| lastReg | numeric | an internal counter keeping track of when the last regeneration event occurred |
| minRelativeB | data.frame | define the cut points to classify stand shadeness |
| mortalityMap | RasterLayer | Mortality map at each succession time step |
| pixelGroupMap | RasterLayer | updated community map at each succession time step |
| regenerationOutput | data.table | TODO: description needed |
| reproductionMap | RasterLayer | Regeneration map at each succession time step |
| simulatedBiomassMap | RasterLayer | Biomass map at each succession time step |
| simulationOutput | data.table | contains simulation results by ecoregion (main output) |
| simulationTreeOutput | data.table | Summary of several characteristics about the stands, derived from cohortData |
| species | data.table | a table that has species traits such as longevity, shade tolerance, etc. Currently obtained from LANDIS-II Biomass Succession v.6.0-2.0 inputs |
| speciesEcoregion | data.table | define the maxANPP, maxB and SEP change with both ecoregion and simulation time |
| speciesLayers | RasterStack | biomass percentage raster layers by species in Canada species map |
| spinupOutput | data.table | Spin-up output |
| summaryBySpecies | data.table | The total species biomass, average age and aNPP across the landscape (used for plotting and reporting). |
| summaryBySpecies1 | data.table | No. pixels of each leading vegetation type (used for plotting and reporting). |
| summaryLandscape | data.table | The averages of total biomass, age and aNPP across the landscape (used for plotting and reporting). |
| treedFirePixelTableSinceLastDisp | data.table | 3 columns: pixelIndex, pixelGroup, and burnTime. Each row represents a forested pixel that was burned up to and including this year, since last dispersal event, with its corresponding pixelGroup and time it occurred |
## $Biomass_regeneration
## [1] "SpaDES.core"
## [2] "crayon"
## [3] "data.table"
## [4] "PredictiveEcology/LandR@development"
## [5] "PredictiveEcology/pemisc@development"
## [6] "raster"
| paramName | paramClass | default | min | max | paramDesc |
|---|---|---|---|---|---|
| calibrate | logical | FALSE | NA | NA | Do calibration? Defaults to FALSE |
| fireInitialTime | numeric | NA | NA | NA | The event time that the first fire disturbance event occurs |
| fireTimestep | numeric | NA | NA | NA | The number of time units between successive fire events in a fire module |
| successionTimestep | numeric | 10 | NA | NA | defines the simulation time step, default is 10 years |
| objectName | objectClass | desc | sourceURL |
|---|---|---|---|
| cohortData | data.table | age cohort-biomass table hooked to pixel group map by pixelGroupIndex at | |
| succession time st | ep | NA | |
| inactivePixelIndex | logical | internal use. Keeps track of which pixels are inactive | NA |
| pixelGroupMap | RasterLayer | updated community map at each succession time step | NA |
| rstCurrentBurn | RasterLayer | Binary raster of fires, 1 meaning ‘burned’, 0 or NA is non-burned | NA |
| species | data.table | a table that has species traits such as longevity… | https://raw.githubusercontent.com/LANDIS-II-Foundation/Extensions-Succession/master/biomass-succession-archive/trunk/tests/v6.0-2.0/species.txt |
| speciesEcoregion | data.table | table defining the maxANPP, maxB and SEP, which can change with both ecoregion and simulation time | https://raw.githubusercontent.com/LANDIS-II-Foundation/Extensions-Succession/master/biomass-succession-archive/trunk/tests/v6.0-2.0/biomass-succession-dynamic-inputs_test.txt |
| sufficientLight | data.frame | table defining how the species with different shade tolerance respond to stand shadeness | https://raw.githubusercontent.com/LANDIS-II-Foundation/ |
| Extensions-Su | ccession/master/biomass-succession-archive/ | ||
| trunk/tests/v | 6.0-2.0/biomass-succession_test.txt | ||
| treedFirePixelTableSinceLastDisp | data.table | 3 columns: pixelIndex, pixelGroup, and burnTime. Each row represents a forested pixel that was burned up to and including this year, since last dispersal event, with its corresponding pixelGroup and time it occurred | NA |
| objectName | objectClass | desc |
|---|---|---|
| cohortData | data.table | age cohort-biomass table hooked to pixel group map by pixelGroupIndex at succession time step |
| lastFireYear | numeric | Year of the most recent fire year |
| pixelGroupMap | RasterLayer | updated community map at each succession time step |
| serotinyResproutSuccessPixels | numeric | Pixels that were successfully regenerated via serotiny or resprouting. This is a subset of treedBurnLoci |
| postFireRegenSummary | data.table | summary table of species post-fire regeneration |
| treedFirePixelTableSinceLastDisp | data.table | 3 columns: pixelIndex, pixelGroup, and burnTime. Each row represents a forested pixel that was burned up to and including this year, since last dispersal event, with its corresponding pixelGroup and time it occurred |
## $Biomass_speciesData
## [1] "SpaDES.core"
## [2] "data.table"
## [3] "magrittr"
## [4] "PredictiveEcology/LandR@development"
## [5] "PredictiveEcology/pemisc@development"
## [6] "pryr"
## [7] "raster"
## [8] "reproducible"
## [9] "SpaDES.tools"
| paramName | paramClass | default | min | max | paramDesc |
|---|---|---|---|---|---|
| coverThresh | integer | 10 | NA | NA | The minimum % cover a species needs to have (per pixel) in the study area to be considered present |
| sppEquivCol | character | Boreal | NA | NA | The column in sim$specieEquivalency data.table to use as a naming convention |
| types | character | KNN | NA | NA | The possible data sources. These must correspond to a function named paste0(‘prepSpeciesLayers_’, types). Defaults to ‘KNN’, to get the Canadian Forestry Service, National Forest Inventory, kNN-derived species cover maps from 2001 - see https://open.canada.ca/data/en/dataset/ec9e2659-1c29-4ddb-87a2-6aced147a990 for metadata |
| vegLeadingProportion | numeric | 0.8 | 0 | 1 | a number that define whether a species is leading for a given pixel |
| .plotInitialTime | numeric | NA | NA | NA | This describes the simulation time at which the first plot event should occur |
| .plotInterval | numeric | NA | NA | NA | This describes the simulation time interval between plot events |
| .saveInitialTime | numeric | NA | NA | NA | This describes the simulation time at which the first save event should occur |
| .saveInterval | numeric | NA | NA | NA | This describes the simulation time interval between save events |
| .useCache | logical | init | NA | NA | Controls cache; caches the init event by default |
| .useParallel | numeric | 64 | NA | NA | Used in reading csv file with fread. Will be passed to data.table::setDTthreads. |
| objectName | objectClass | desc | sourceURL |
|---|---|---|---|
| rasterToMatchLarge | RasterLayer | a raster of the studyAreaLarge in the same resolution and projection as biomassMap | |
| sppColorVect | character | A named vector of colors to use for plotting. The names must be in sim\(speciesEquivalency[[sim\)sppEquivCol]], and should also contain a color for ‘Mixed’ | NA |
| sppEquiv | data.table | table of species equivalencies. See LandR::sppEquivalencies_CA. | |
| studyAreaLarge | SpatialPolygonsDataFrame | Polygon to use as the parametrisation study area. (studyAreaLarge is only used for parameter estimation, and can be larger than the actual study area used for LandR Biomass simulations). If not provided by the user, it will default to an area in Southwestern Alberta, Canada (which is the same as the default study area used for LandR Biomass simulations). | NA |
| studyAreaReporting | SpatialPolygonsDataFrame | multipolygon (typically smaller/unbuffered than studyArea) to use for plotting/reporting. Defaults to an area in Southwestern Alberta, Canada. | NA |
| objectName | objectClass | desc |
|---|---|---|
| speciesLayers | RasterStack | biomass percentage raster layers by species in Canada species map |
| treed | data.table | one logical column for each species, indicating whether there were non-zero values |
| numTreed | numeric | a named vector with number of pixels with non-zero cover values |
| nonZeroCover | numeric | A single value indicating how many pixels have non-zero cover |
## $LandMine
## [1] "SpaDES.core"
## [2] "data.table"
## [3] "ggplot2"
## [4] "grDevices"
## [5] "magrittr"
## [6] "PredictiveEcology/LandR@development"
## [7] "PredictiveEcology/pemisc@development"
## [8] "PredictiveEcology/SpaDES.tools@development"
## [9] "raster"
## [10] "RColorBrewer"
## [11] "VGAM"
| paramName | paramClass | default | min | max | paramDesc |
|---|---|---|---|---|---|
| biggestPossibleFireSizeHa | numeric | 1e+06 | 10000 | 2e+06 | An upper limit, in hectares, of the truncated Pareto distribution of fire sizes |
| burnInitialTime | numeric | start(sim, “year”) + 1 | NA | NA | This describes the simulation time at which the first plot event should occur |
| fireTimestep | numeric | 1 | NA | NA | This describes the simulation time at which the first plot event should occur |
| flushCachedRandomFRI | logical | FALSE | NA | NA | If no Fire Return Interval map is supplied, then a random one will be created and cached. Use this to make a new one. |
| minPropBurn | numeric | 0.9 | 0 | 1 | Minimum proportion burned pixels to use when triggering warnings about simulated fires. |
| mixedType | numeric | 2 | NA | NA | How to define mixed stands: 1 for any species admixture; 2 for deciduous > conifer. See ?vegTypeMapGenerator. |
| maxRetriesPerID | integer | 10 | 0 | 20 | Minimum proportion burned pixels to use when triggering warnings about simulated fires. |
| sppEquivCol | character | LandR | NA | NA | The column in sim$specieEquivalency data.table to use as a naming convention |
| useSeed | integer | NULL | NA | NA | Only used for creating a starting cohortData dataset. If NULL, then it will be randomly generated; If non-NULL, will pass this value to set.seed and be deterministic and identical each time. WARNING: setting the seed to a specific value will cause all simulations to be identical! |
| vegLeadingProportion | numeric | 0.8 | 0 | 1 | a number that define whether a species is leading for a given pixel |
| .plotInitialTime | numeric | start(sim, “year”) + 1 | NA | NA | This describes the simulation time at which the first plot event should occur |
| .plotInterval | numeric | 1 | NA | NA | This describes the simulation time interval between plot events |
| .saveInitialTime | numeric | NA | NA | NA | This describes the simulation time at which the first save event should occur |
| .saveInterval | numeric | NA | NA | NA | This describes the simulation time interval between save events |
| .useCache | logical | FALSE | NA | NA | Should this entire module be run with caching activated? This is generally intended for data-type modules, where stochasticity and time are not relevant |
| .unitTest | logical | TRUE | NA | NA | Some functions can have internal testing. This will turn those on or off, if any exist |
| .useParallel | numeric | 2 | NA | NA | Used in burning. Will be passed to data.table::setDTthreads. NOTE: should be <= 2 as the additonal RAM overhead too high given marginal speedup. |
| objectName | objectClass | desc | sourceURL |
|---|---|---|---|
| cohortData | data.table | Columns: B, pixelGroup, speciesCode (as a factor of the names), Indicating several features about ages and current vegetation of stand | NA |
| fireReturnInterval | Raster | A raster layer that is a factor raster, with at least 1 column called fireReturnInterval, representing the fire return interval in years | NA |
| pixelGroupMap | RasterLayer | Pixels with identical values share identical stand features | NA |
| rasterToMatch | RasterLayer | DESCRIPTION NEEDED | NA |
| rasterToMatchReporting | RasterLayer | Raster layer of study area used for plotting and reporting only. Defaults to the kNN biomass map masked with studyArea |
http://tree.pfc.forestry.ca/kNN-StructureBiomass.tar |
| ROSTable | data.table | A data.table with 3 columns, ‘age’, ‘leading’, and ‘ros’. The values under the ‘age’ column can be ‘mature’, ‘immature’, ‘young’ and compound versions of these, e.g., ‘immature_young’ which can be used when 2 or more age classes share same ‘ros’. ‘leading’ should be | NA |
| rstFlammable | Raster | A raster layer, with 0, 1 and NA, where 1 indicates areas that are flammable, 0 not flammable (e.g., lakes) and NA not applicable (e.g., masked) | NA |
| rstTimeSinceFire | Raster | a time since fire raster layer | NA |
| species | data.table | Columns: species, speciesCode, Indicating several features about species | NA |
| sppColorVect | character | named character vector of hex colour codes corresponding to each species | NA |
| sppEquiv | data.table | Multi-columned data.table indicating species name equivalencies. Default is taken from LandR sppEquivalencies_CA which has names for species of trees in Canada | NA |
| studyAreaReporting | SpatialPolygonsDataFrame | multipolygon (typically smaller/unbuffered than studyArea) to use for plotting/reporting. Defaults to an area in Southwestern Alberta, Canada. | NA |
| objectName | objectClass | desc |
|---|---|---|
| fireInitialTime | numeric | The initial event time of the burn event. This is simply a reassignment from P(sim)$burnInitialTime. |
| fireSizes | list | A list of data.tables, one per burn event, each with two columns, size and maxSize. These indicate the actual sizes and expected sizes burned, respectively. These can be put into a single data.table with rbindlist(sim$fireSizes, idcol = ‘year’) |
| fireReturnInterval | RasterLayer | A Raster map showing the fire return interval. This is created from the rstCurrentBurn. |
| fireReturnIntervalsByPolygonNumeric | numeric | A vector of the fire return intervals, ordered by the numeric representation of polygon ID |
| fireTimestep | numeric | The number of time units between successive fire events in a fire module. |
| kBest | numeric | A numeric scalar that is the optimal value of K in the Truncated Pareto distribution (rtruncpareto) |
| numFiresPerYear | numeric | The average number of fires per year, by fire return interval level on rstCurrentBurn. |
| rstCurrentBurn | RasterLayer | A raster layer, produced at each timestep, where each pixel is either 1 or 0 indicating burned or not burned. |
| rstCurrentBurnCumulative | RasterLayer | Cumulative number of times a pixel has burned |
| sppEquiv | data.table | Same as input, but with new column, LandMine |
## $LandWeb_output
## [1] "SpaDES.core"
## [2] "data.table"
## [3] "PredictiveEcology/LandR@development"
## [4] "PredictiveEcology/pemisc@development"
## [5] "raster"
## [6] "SpaDES.tools"
| paramName | paramClass | default | min | max | paramDesc |
|---|---|---|---|---|---|
| mixedType | numeric | 2 | NA | NA | How to define mixed stands: 1 for any species admixture; 2 for deciduous > conifer. See ?vegTypeMapGenerator. |
| sppEquivCol | character | LandWeb | NA | NA | The column in sim$specieEquivalency data.table to use as a naming convention |
| summaryInterval | numeric | 50 | NA | NA | This describes summary interval for this module |
| vegLeadingProportion | numeric | 0.8 | 0 | 1 | a number that define whether a species is leading for a given pixel |
| .plotInitialTime | numeric | 0 | NA | NA | This describes the simulation time at which the first plot event should occur |
| .plotInterval | numeric | 1 | NA | NA | This describes the simulation time interval between plot events |
| .useCache | logical | FALSE | NA | NA | Should this entire module be run with caching activated? This is generally intended for data-type modules, where stochasticity and time are not relevant |
| objectName | objectClass | desc | sourceURL |
|---|---|---|---|
| cohortData | data.table | age cohort-biomass table hooked to pixel group map by pixelGroupIndex at succession time step, this is imported from forest succession module | |
| fireReturnInterval | Raster | A raster layer that is a factor raster, with at least 1 column called fireReturnInterval, representing the fire return interval in years | NA |
| pixelGroupMap | RasterLayer | updated community map at each succession time step | |
| rasterToMatch | RasterLayer | this raster contains two pieces of information: Full study area with fire return interval attribute | NA |
| rstTimeSinceFire | Raster | a time since fire raster layer | NA |
| species | data.table | Columns: species, speciesCode, Indicating several features about species | https://raw.githubusercontent.com/dcyr/LANDIS-II_IA_generalUseFiles/master/speciesTraits.csv |
| sppColorVect | character | A named vector of colors to use for plotting. The names must be in sim\(speciesEquivalency[[sim\)sppEquivCol]], and should also contain a color for ‘Mixed’ | NA |
| sppEquiv | data.table | table of species equivalencies. See LandR::sppEquivalencies_CA. | |
| speciesLayers | RasterStack | biomass percentage raster layers by species in Canada species map | http://tree.pfc.forestry.ca/kNN-Species.tar |
| standAgeMap | RasterLayer | stand age map in study area, default is Canada national stand age map | http://tree.pfc.forestry.ca/kNN-StructureStandVolume.tar |
| studyArea | SpatialPolygonsDataFrame | multipolygon to use as the study area, with attribute LTHFC describing the fire return interval. Defaults to a square shapefile in Southwestern Alberta, Canada. | |
| studyAreaReporting | SpatialPolygonsDataFrame | multipolygon (typically smaller/unbuffered than studyArea) to use for plotting/reporting. Defaults to an area in Southwestern Alberta, Canada. | NA |
| summaryPeriod | numeric | a numeric vector contains the start year and end year of summary |
| objectName | objectClass | desc |
|---|---|---|
| vegTypeMap | Raster | NA |
## $LandWeb_preamble
## [1] "SpaDES.core"
## [2] "achubaty/amc@development"
## [3] "crayon"
## [4] "dplyr"
## [5] "fasterize"
## [6] "ggplot2"
## [7] "magrittr"
## [8] "maptools"
## [9] "PredictiveEcology/LandR@development"
## [10] "PredictiveEcology/map@development"
## [11] "PredictiveEcology/pemisc@development"
## [12] "raster"
## [13] "RColorBrewer"
## [14] "RCurl"
## [15] "reproducible"
## [16] "rgeos"
## [17] "scales"
## [18] "sf"
## [19] "sp"
## [20] "SpaDES.tools"
## [21] "XML"
| paramName | paramClass | default | min | max | paramDesc |
|---|---|---|---|---|---|
| bufferDist | numeric | 25000 | 20000 | 1e+05 | Study area buffer distance (m) used to make studyArea. |
| bufferDistLarge | numeric | 50000 | 20000 | 1e+05 | Study area buffer distance (m) used to make studyAreaLarge. |
| friMultiple | numeric | 1 | 1 | 2 | Multiplication factor for adjusting fire return intervals. |
| mapResFact | numeric | 1 | 1 | 10 | The map resolution factor to use with raster::disaggregate to reduce pixel size below 250 m. Should be one of 1, 2, 5, 10, which correspends to pixel size of 250m, 125m, 50m, 25m, repsectively. |
| minFRI | numeric | 40 | 0 | 200 | The value of fire return interval below which, pixels will be changed to NA, i.e., ignored |
| runName | character | NA | NA | NA | A description for run; this will form the basis of cache path and output path |
| treeClassesLCC | numeric | c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 20, 32, 34, 35, 36) | 0 | 39 | The classes in the LCC2005 layer that are considered ‘trees’ from the perspective of LandR-Biomass |
| treeClassesToReplace | numeric | 34:36 | 0 | 39 | The transient classes in the LCC2005 layer that will become ‘trees’ from the perspective of LandR-Biomass (e.g., burned) |
| .plotInitialTime | numeric | NA | NA | NA | This describes the simulation time at which the first plot event should occur |
| .plotInterval | numeric | NA | NA | NA | This describes the simulation time interval between plot events |
| .saveInitialTime | numeric | NA | NA | NA | This describes the simulation time at which the first save event should occur |
| .saveInterval | numeric | NA | NA | NA | This describes the simulation time interval between save events |
| .useCache | logical | FALSE | NA | NA | Should this entire module be run with caching activated? This is generally intended for data-type modules, where stochasticity and time are not relevant |
| objectName | objectClass | desc | sourceURL |
|---|---|---|---|
| canProvs | SpatialPolygonsDataFrame | Canadian provincial boundaries shapefile | NA |
| objectName | objectClass | desc |
|---|---|---|
| CC TSF | RasterLayer | NA |
| fireReturnInterval | RasterLayer | NA |
| LandTypeCC | RasterLayer | NA |
| LCC2005 | RasterLayer | NA |
| ml | map | NA |
| LCC | RasterLayer | A key output from this module: it is the result of LandR::overlayLCCs on LCC2005 and LandTypeCC |
| nonTreePixels | integer | NA |
| rasterToMatch | RasterLayer | NA |
| rasterToMatchReporting | RasterLayer | NA |
| rstFlammable | RasterLayer | NA |
| studyArea | SpatialPolygonsDataFrame | NA |
| studyAreaLarge | SpatialPolygonsDataFrame | NA |
| studyAreaReporting | SpatialPolygonsDataFrame | NA |
## $timeSinceFire
## [1] "SpaDES.core" "raster"
| paramName | paramClass | default | min | max | paramDesc |
|---|---|---|---|---|---|
| returnInterval | numeric | 1 | NA | NA | interval between main events |
| startTime | numeric | 0 | NA | NA | time of first burn event |
| .plotInitialTime | numeric | NA | NA | NA | This describes the simulation time at which the first plot event should occur |
| .plotInterval | numeric | NA | NA | NA | This describes the simulation time at which the first plot event should occur |
| .saveInitialTime | numeric | NA | NA | NA | This describes the simulation time at which the first save event should occur |
| .saveInterval | numeric | NA | NA | NA | This describes the simulation time at which the first save event should occur |
| .useCache | logical | FALSE | NA | NA | This describes the simulation time at which the first save event should occur |
| objectName | objectClass | sourceURL | desc |
|---|---|---|---|
| rstFlammable | RasterLayer | A binary Raster, where 1 means ‘can burn’ | |
| fireReturnInterval | RasterLayer | A Raster where the pixels represent the fire return interval, in years | |
| rstCurrentBurn | RasterLayer | A binary Raster, where 1 means that there was a fire in the current year in that pixel | |
| fireTimestep | numeric | The time between burn events, in years. Only tested with this equal to 1 |
| objectName | objectClass | desc |
|---|---|---|
| rstTimeSinceFire | RasterLayer | A Raster where the pixels represent the number of years since last burn |
| burnLoci | numeric | A integer vector of cell indices where burns occurred in the latest year. It is derived from rstCurrentBurn |
library(SpaDES.core)
library(LandWebUtils)
fsim <- simFile("mySim_landweb", "docs", 0)
mySim_landweb <- if (!file.exists(fsim)) {
modules_landweb <- c("LandWeb_preamble", "Biomass_speciesData", "Biomass_core", "LandMine",
"Biomass_regeneration", "LandWeb_output", "timeSinceFire")
Cache(simInit,
times = times3,
params = parameters3,
modules = modules_landweb,
outputs = outputs3,
objects = objects3,
paths = paths3,
loadOrder = unlist(modules_landweb),
omitArgs = c("debug", "paths", ".plotInitialTime")
)
saveSimList(mySim_landweb, fsim)
} else {
loadSimList(fsim)
}
png(file.path("docs", "LandWeb_module_diagram.png"), height = 1800, width = 3200)
moduleDiagram(mySim_landweb)
dev.off()
## currently not working: see https://github.com/rich-iannone/DiagrammeR/issues/207
## workaround is to use Rstudio's manual export ability :S
objectDiagram(mySim_landweb, height = 2500, width = 1250) # %>%
# DiagrammeRsvg::export_svg() %>%
# charToRaw() %>%
# rsvg::rsvg() %>%
# png::writePNG(file.path("docs", "LandWeb_object_diagram.png"))